package com.sensoro.study.io;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.Reader;
import java.io.StringReader;

public class IoStudy {

    public static void main(String[] args) throws IOException {

        System.out.println(readData("adfasdfasdfasdfasdfasdf"));
    }

    static String readData(String message) throws IOException {
        Reader reader = new StringReader(message);
        BufferedReader br = new BufferedReader(reader);
        // 不需要重新声明变量
        try (br) {
            return br.readLine();
        }
    }
}
